using System.Data;
using System.Linq;
using System.Collections.Generic;

namespace Ayatta.Common.Extension
{
    public static class DataTableExtension
    {
        public static IEnumerable<dynamic> AsDynamic(this DataTable dt)
        {
            return from DataRow row in dt.Rows select row.AsDynamic();
        }

        public static dynamic AsDynamic(this DataRow row)
        {
            return new DynamicDataRow(row);
        }
    }
}